<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="org.apache.commons.lang.time.DateFormatUtils"%>
<%@page import="org.springframework.util.CollectionUtils"%>
<%@page import="java.util.Collection"%>
<%@ include file="../common/common_include.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	List<TblCheckHoliday> list = (List<TblCheckHoliday>)request.getAttribute("list");
	HolidayForm form = (HolidayForm)request.getAttribute("command");
%>
<div class="main">
	<div class="oaTable">
<table class="tableList">

	<thead>
		<tr>
			<td colspan="7" style="width: 100%;">
				<div class="FormTools">
					<div>
						<input type="button" class="searchSubmit" onclick="javascript:XF.Check.holidayListSearch()" value="搜索"/>						
					</div>
					<div>所属公司：
						<select id="siteList" class="easyui-combobox" name="siteid" style="width:100px;"></select>
					</div>
				</div>
			</td>
		</tr>
	</thead>

	<tbody>
		<tr id="tableHeader">
			<th style="width: 15%">所属公司</th>
			<th style="width: 15%">节假日名称</th>
			<th style="width: 15%">开始日期</th>
			<th style="width: 15%">结束日期</th>
			<th style="width: 10%">操作人</th>
			<th style="width: 12%">操作时间</th>
			<th style="width: 18%">操作</th>
		</tr>
		<%
			if (list != null && list.size() > 0) {
				for (TblCheckHoliday holiday: list) {
					String id = EncrypTool.encode(holiday.getId()+"");
		%>
						<tr>
							<td><%=holiday.getSitename() %></td>
							<td><%=holiday.getName() %></td>
							<td><%=DateFormatUtils.format(holiday.getStartdate(), "yyyy-MM-dd HH:mm:ss") %></td>
							<td><%=DateFormatUtils.format(holiday.getEnddate(), "yyyy-MM-dd HH:mm:ss") %></td>
							<td><%=holiday.getOperateUser() %></td>
							<td><%=DateFormatUtils.format(holiday.getOperateTime(), "yyyy-MM-dd HH:mm:ss") %></td>
							<td>
								<div class="innerBtnWrap">
									<sec:authorize ifAnyGranted="MANAGE_CHECK,CHECK_EDIT_HOLIDAY">
									<a class="a-btn-microsoft btn" href="javascript:XF.Check.editHoliday('<%=id %>')">修改</a>
									</sec:authorize>
									<sec:authorize ifAnyGranted="MANAGE_CHECK,CHECK_DELETE_HOLIDAY">
									<a class="a-btn-microsoft btn topBtn" href="javascript:XF.Check.deleteHoliday('<%=id %>')">删除</a>
									</sec:authorize>
								</div>
							</td>
						</tr>
					<%
				}
			}
		
		%>
		        
        		<tr id="tableFooter">
			<td colspan="7">
				<div class="pagination">
					<monggoTag:pagination href="holiday_search"
						pageSize="<%=form.getPageSize()%>"
						totalRecord="<%=form.getTotalRecord() %>"
						currentPage="<%=form.getPageNum() %>">
					</monggoTag:pagination>
				</div>
			</td>
		</tr>
	</tbody>
</table>
</div>
</div>
<script>
$('#siteList').combobox({
	url:global.contextPath + '/company/siteList',
	valueField:'siteid',
	textField:'sitename',
	panelHeight: '300'
});
$('#siteList').combobox('setValue', '<%=form.getSiteid() %>');
</script>